/*
 * @(#)OrderService.java 2013-4-11 下午04:31:18
 *
 * Copyright 2013 Beijing Axesline Technology Co..Ltd All rights reserved.
 * 该程序的所有权为北京铭扬谷地咨询有限公司 .
 * 使用之前必须得到北京铭扬谷地咨询有限公司的许可;
 */
package com.minyond.demo.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.minyond.demo.entity.Order;
import com.minyond.demo.repository.OrderDao;

/**
 * <p>Description:</p>
 * <p>Copyright: Copyright (c)2013</p>
 * <p>Company: minyond</p>
 * <P>Created Date :2013-4-11</P> 
 * @author zhangfeng
 * @version 1.0
 */
@Component
@Transactional(readOnly = true)
public class OrderService {
    
    private OrderDao orderDao;
    
    public List<Order> getAllOrder() {
        return (List<Order>) orderDao.findAll();
    }

    public Order getOrder(Long id) {
        return orderDao.findOne(id);
    }
    
    public void saveOrder(Order order){
        
        this.orderDao.save(order);
    }
    
    @Autowired
    public void setOrderDao(OrderDao orderDao) {
        this.orderDao = orderDao;
    }
}
